<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //模式结构匹配
        //{} = {}

        //属性名相同的完成赋值

        const {
            "name": name,
            "age": age
        } = {
            name: "Cai",
            age: 19
        }
        console.log(name, age) //Cai 19




        const {
            name,
            age
        } = {
            age: 19,
            name: "Cai"
        }
        console.log(age, name); //19 'Cai'
    </script>
</body>

</html>